namespace DotNetNuke.Services.Cache
{
    using DotNetNuke.Framework;
    using System;
    using System.Collections;
    using System.Web.Caching;

    public abstract class CachingProvider
    {
        private static CachingProvider objProvider = null;

        static CachingProvider()
        {
            CreateProvider();
        }

        public abstract object Add(string Key, object Value, CacheDependency Dependencies, DateTime AbsoluteExpiration, TimeSpan SlidingExpiration, CacheItemPriority Priority, CacheItemRemovedCallback OnRemoveCallback);
        private static void CreateProvider()
        {
            objProvider = (CachingProvider) Reflection.CreateObject("caching", false);
        }

        public abstract IDictionaryEnumerator GetEnumerator();
        public abstract object GetItem(string CacheKey);
        public abstract object GetPersistentCacheItem(string CacheKey, Type objType);
        public abstract void Insert(string CacheKey, object objObject, bool PersistAppRestart);
        public abstract void Insert(string CacheKey, object objObject, CacheDependency objDependency, bool PersistAppRestart);
        public abstract void Insert(string CacheKey, object objObject, CacheDependency objDependency, DateTime AbsoluteExpiration, TimeSpan SlidingExpiration, bool PersistAppRestart);
        public abstract void Insert(string CacheKey, object objObject, CacheDependency objDependency, DateTime AbsoluteExpiration, TimeSpan SlidingExpiration, CacheItemPriority Priority, CacheItemRemovedCallback OnRemoveCallback, bool PersistAppRestart);
        public static CachingProvider Instance()
        {
            return objProvider;
        }

        public abstract string PurgeCache();
        public abstract void Remove(string CacheKey);
        public abstract void RemovePersistentCacheItem(string CacheKey);
    }
}

